package com.wj.demo;

public class Test01 {

    public static void main(String[] args) {

    }

    //水仙花数 例如 153=1*1*1+5*5*5+3*3*3;
    public void testFlower(){
        for (int i=1;i<=999999999;i++){
            int x = i/100;
            int y = (i/10)%10;
            int z = i%10;
            int num = x*x*x+y*y*y+z*z*z;
            if (i == num){
                System.out.println(num);
            }
        }
    }

    //冒泡排序
    public void testMaoPao(int arr[]){
        if (arr == null || arr.length < 2){
            return;
        }
        for (int i=0;i<arr.length-1;i++){
            for (int j=0;j<arr.length-i-1;j++){
                int temp = arr[j];
                arr[j] = arr[j+1];
                arr[j+1] = temp;
            }
        }
    }
}